home *** CD-ROM | disk | FTP | other *** search
Gui4CLI script | 1997-10-03 | 11.6 KB | 514 lines |
- G4C
-
- ; $VER: Gui4Cli.gc 3.2
- ; =================================================================
- ; This is the gui which is opened when you click the "Prefs" button
- ; on the Gui4Cli requester.
-
- ; If you find yourself feeling queezy after having suffered the full
- ; effect of it's poping open at you unwarned, you may change it as
- ; you see fit..
-
-
- WINBIG 179 24 299 201 "Gui4Cli"
- WinType 11110001
-
- BOX 0 0 297 201 out button
- ;* ICON 244 11 "guis:gui4cli"
-
- ; -----------------------------------------------------------------
- ; System events
- ; -----------------------------------------------------------------
-
- xOnLoad
- setgadvalues gui4cli.gc ; set default values
- setgad gui4cli.gc 72 off
- mode = GUI
- lvhelp = 'Choose guis to load'
- oldguidir = GUIs:
- update gui4cli.gc 50 'Port: $$g4c.port'
- gosub gui4cli.gc guichange
- guiopen Gui4Cli.gc
-
- xonreload
- guiopen Gui4Cli.gc
- guiscreen gui4cli.gc front
-
- xOnOpen
- SetGad Gui4Cli.gc 1 OFF ; remove the appicon
- lvuse Gui4Cli.gc 10 ; & refresh the listview
- lvdir refresh
-
- xOnClose
- SetGad Gui4Cli.gc 1 ON ; open the appicon
-
- xOnFail
- ezreq "Failed.." OK ""
-
- xAppIcon 0 0 GUIs:Gui4Cli "Gui4Cli" apivar OFF
- GadID 1
- GuiOpen Gui4Cli.gc
- GuiScreen Gui4Cli.gc FRONT
- if $apivar > ' '
- andifexists DIRECTORY $apivar ; if a directory or volume icon was
- orifexists DOS $apivar ; dropped on the icon,
- lvuse Gui4Cli.gc 10 ; we cd to it..
- lvdir #$apivar
- endif
-
- ; -----------------------------------------------------------------
- ; Main mode CYCLER
- ; - will rotate gui through all modes
- ; -----------------------------------------------------------------
-
- XCYCLER 6 4 120 15 '' mode
- gadid 900
- gadhelp 'Will cycle the gui through its modes'
- cstr 'GUI Control' GUI
- cstr 'GUI Load' LOAD
- cstr 'Settings' SET
- gosub gui4cli.gc guichange
-
-
- xroutine guichange
- docase $mode
- case = GUI
- setgad gui4cli.gc 10 HIDE ; the listview
- setgad gui4cli.gc 50/59 SHOW ; other lv & Open/close/quit etc
- setgad gui4cli.gc 60/100 HIDE
- lvuse Gui4Cli.gc 54
- lvdir #env:$$g4c.port
- setwintitle gui4cli.gc 'Port $$g4c.port : Home '
- break
-
- case = LOAD
- setgad gui4cli.gc 10 SHOW
- setgad gui4cli.gc 50/58 HIDE
- setgad gui4cli.gc 59 SHOW
- setgad gui4cli.gc 60/79 SHOW
- setgad gui4cli.gc 80/100 HIDE
- lvhelp = 'Choose guis from here'
- setwintitle gui4cli.gc '$oldguidir '
- break
-
- case = SET
- setgad gui4cli.gc 10 HIDE
- setgad gui4cli.gc 50/79 HIDE
- setgad gui4cli.gc 80/89 SHOW
- setwintitle gui4cli.gc 'Gui4Cli settings'
- break
-
- endcase
- partredraw gui4cli.gc 4 20 291 178
-
-
- ; -----------------------------------------------------------------
- ; Listview for GUI mode
- ; -----------------------------------------------------------------
-
- XLISTVIEW 6 66 285 132 "" guivar '' 0 DIR
- gadid 54
- gadfont #mono 8 000
- gadhelp 'These are the guis currently loaded'
- extract guivar file fname
- guiopen $fname
-
- ; -----------------------------------------------------------------
- ; GUI mode
- ; will act on the selected listview items
- ; -----------------------------------------------------------------
-
- TEXT 105 25 174 15 port 35 BOX
- gadid 50
-
- XBUTTON 15 45 20 14 "R" ; refresh list
- gadid 51
- gadhelp 'Refreshes the list of loaded guis'
- lvuse Gui4Cli.gc 54
- lvdir refresh
-
- XBUTTON 40 45 58 14 Open ; open
- gadid 51
- gadhelp 'Will open the selected guis'
- lvuse Gui4Cli.gc 54
- lvmulti first
- while $guivar > ''
- extract guivar file fname
- guiopen $fname
- lvmulti next
- endwhile
- lvdir none
-
- XBUTTON 100 45 58 14 Close ; close
- gadid 52
- gadhelp 'Will close the selected guis'
- lvuse Gui4Cli.gc 54
- lvmulti first
- while $guivar > ''
- extract guivar file fname
- guiclose $fname
- lvmulti next
- endwhile
- lvdir none
-
- XBUTTON 160 45 58 14 Unload ; unload
- gadid 53
- gadhelp 'Will quit the selected guis'
- lvuse Gui4Cli.gc 54
- lvmulti first
- while $guivar > ''
- extract guivar file fname
- guiquit $fname
- lvmulti next
- endwhile
- ; the guis won't actually quit until all commands have executed, so..
- reflag = 1
-
- xAfter
- if $reflag = 1
- reflag = 0
- lvdir refresh
- endif
-
- XBUTTON 235 45 20 14 "A" ; also shown in gui mode
- gadhelp 'Select all items'
- gadid 51
- lvuse Gui4Cli.gc 54
- lvdir all
-
- XBUTTON 255 45 20 14 "N"
- gadhelp 'Unselect all items'
- gadid 51
- lvuse Gui4Cli.gc 54
- lvdir none
-
- BOX 6 22 284 41 in button
- GADID 59
-
- CTEXT 18 27 'GUI Control' #screen 8 2 0 0001
- gadid 50
-
-
- ; -----------------------------------------------------------------
- ; Listview for LOAD/FAV mode
- ; -----------------------------------------------------------------
-
- XLISTVIEW 6 66 285 132 "" guivar GUIs: 0 DIR
- gadid 10
- gadfont #mono 8 000
- gadhelp 'Listview : $lvhelp' ; we set it above according to mode
- docase $mode
- case = FAV
- setgad gui4cli.gc 71 on ; if double clicked in FAV mode
- setgad gui4cli.gc 60/63 on ; set it back to LOAD mode
- setgad gui4cli.gc 72 off ; and cd to selection
- lvhelp = 'Choose guis to load'
- lvmode DIR
- lvdir #$guivar
- mode = LOAD
- break
- case = LOAD
- if $guivar H= G4C
- guiload $guivar
- endif
- break
- endcase
-
- xlvdirhook 10
- if $mode = LOAD
- oldguidir = $$lv.dir
- setwintitle gui4cli.gc '$oldguidir '
- endif
-
- ; -----------------------------------------------------------------
- ; Load mode
- ; -----------------------------------------------------------------
-
- ; for the box use the same as above (gadid 59)
-
- CTEXT 20 27 GuiLoad #screen 8 2 0 0001
- gadid 60
-
-
- XBUTTON 24 42 80 14 Load ; load
- gadhelp 'Will load the selected files if they are guis'
- gadid 60
- lvuse Gui4Cli.gc 10
- lvmulti first
- while $guivar > ''
- if $guivar H= G4C
- guiload $guivar
- endif
- lvmulti next
- endwhile
- lvdir none
-
- XBUTTON 117 42 20 14 "P"
- gadhelp 'CD to Parent dir'
- gadid 60
- lvuse Gui4Cli.gc 10
- lvdir parent
- oldguidir = $$lv.dir
- setwintitle gui4cli.gc '$oldguidir '
-
- XBUTTON 138 42 20 14 "D"
- gadhelp 'Show Volumes list'
- gadid 60
- lvuse Gui4Cli.gc 10
- lvdir disks
- oldguidir = ''
- setwintitle gui4cli.gc 'Devices'
-
- XBUTTON 171 42 20 14 "G"
- gadhelp 'Shortcut to GUIs:'
- gadid 60
- lvuse Gui4Cli.gc 10
- lvdir #Guis:
- oldguidir = GUIs:
- setwintitle gui4cli.gc 'GUIs:'
-
- XBUTTON 117 27 20 14 "A" ; also shown in gui mode
- gadhelp 'Select all items'
- gadid 60
- lvuse Gui4Cli.gc 10
- lvdir all
-
- XBUTTON 138 27 20 14 "N"
- gadhelp 'Unselect all items'
- gadid 60
- lvuse Gui4Cli.gc 10
- lvdir none
-
-
- ; -----------------------------------------------------------------
- ; Favourites control
- ; -----------------------------------------------------------------
-
- XBUTTON 192 27 58 14 "Fav"
- gadid 70
- gadhelp 'Switches to and from Favourites mode'
- lvuse gui4cli.gc 10
- if $mode = FAV
- setgad gui4cli.gc 71 on
- setgad gui4cli.gc 60/63 on
- setgad gui4cli.gc 72 off
- lvhelp = 'Choose guis to load'
- lvmode DIR
- lvdir #$oldguidir
- mode = LOAD
- else
- setgad gui4cli.gc 71 off
- setgad gui4cli.gc 60/63 off
- setgad gui4cli.gc 72 on
- lvhelp = 'Double click on a directory, or hit FAV again to cancel'
- lvmode MULTI
- lvchange guis:tools/fav/G4C.fav
- lvsort asc
- mode = FAV
- endif
-
- XBUTTON 252 27 29 14 "+"
- gadid 71
- gadhelp 'Adds the current dir the Listview is at, to your favourites'
- lvuse gui4cli.gc 10
- append guis:tools/fav/g4c.fav '\n$$lv.dir'
-
- XBUTTON 252 42 29 14 "-"
- gadid 72
- gadhelp 'Deletes selected favourite entries'
- lvuse gui4cli.gc 10
- lvmulti first
- while $guivar > ''
- lvdel -1
- lvmulti first
- endwhile
-
- XBUTTON 192 42 58 14 "Save"
- gadid 72
- gadhelp 'Save favourites to GUIs:tools/fav/G4C.fav'
- lvuse gui4cli.gc 10
- lvsave guis:tools/fav/g4c.fav
-
-
- ; -----------------------------------------------------------------
- ; Gui4Cli Settings
- ; -----------------------------------------------------------------
-
-
- BOX 10 90 276 41 in button
- gadid 80
-
- CTEXT 20 27 'Settings:' #screen 8 2 0 0001
- gadid 80
-
- XCHECKBOX 75 40 25 15 "Debug" dbg "1" "0" OFF
- gadid 80
- gadhelp 'Sets DEBUG mode On/Off'
- if $dbg = 1
- set debug on
- else
- set debug off
- endif
-
- XCHECKBOX 75 60 25 15 Help hlp "1" "0" OFF
- gadid 80
- gadhelp 'Sets HELP On/Off'
- if $hlp = 1
- set help on
- else
- set help off
- endif
-
- XPALETTE 160 60 106 15
- gadid 81
- gadhelp 'Loads the GUIs:tools/palette.gc gui'
- guiload guis:tools/palette.gc
- guiopen palette.gc
-
- XHSLIDER 160 30 90 12 Grid grid 1 20 1 "%ld"
- gadid 82
- gadhelp 'Sets the size of the Edit Grid'
- set grid $grid
-
- XHSLIDER 160 45 90 12 "Tabs" tab 0 20 8 "%ld"
- gadid 82
- gadhelp 'Sets the TAB size'
- set tab $tab
-
- ; -----------------------------------------------------------------
- ; Gui4Cli paths Settings
- ; -----------------------------------------------------------------
-
-
- BOX 10 23 277 60 IN BUTTON
- gadid 83
-
- CTEXT 20 95 'Set Paths:' #screen 8 2 0 0001
- gadid 83
-
- XTEXTIN 20 110 255 15 "" path c:Ed 140
- gadid 84
- gadhelp 'Enter the new path etc here..'
- set $setpath $path
-
- XCYCLER 115 95 160 14 "" setpath
- gadid 83
- gadhelp 'Cycles through the various things you can set.'
- CSTR 'Editor' 'editor'
- CSTR 'File Pattern' 'filepattern'
- cstr 'GuiFile Pattern' 'guipattern'
- cstr 'Gui Load dir' 'guiloaddir'
- cstr 'Default Screen' 'defscreen'
- CSTR 'Output' 'output'
- temp = '\$\$G4C.$setpath'
- update gui4cli.gc 84 '$temp'
-
- ; -----------------------------------------------------------------
- ; Spare area..
- ; -----------------------------------------------------------------
-
- ; You may add stuff here.. - give them all an id of 85
-
- BOX 10 139 276 53 IN BUTTON
- gadid 85
-
- CTEXT 21 145 "Configure:" "#screen" 8 2 0 "0001"
- gadid 85
-
- XBUTTON 69 161 167 14 "Configure.."
- gadid 85
- gadhelp 'Configure External players'
- ifexists variable *DEF.EDITOR
- else
- guiload guis:tools/prefs/players
- endif
- guiload guis:tools/config.gc
-
-
- ; -----------------------------------------------------------------
- ; Menus
- ; -----------------------------------------------------------------
-
-
- xMenu Project New.. '' N ; new gui
- guiclose gui4cli.gc
- guiload guis:tools/guiedit.gc
- gosub guiedit.gc newfile
- if $$ret.0 = 1 ; a gui was chosen
- guiopen guiedit.gc
- endif
-
- xmenu Project Gui.. '' '' ; use the status requester
- status
-
- xMenu Project BARLABEL '' ''
-
- xMenu Project About.. '' ''
- ezreq 'Gui4Cli 3.2\n(c)1995-97 D.Keletsekis\ndck@prometheus.hol.gr' 'OK' ''
-
- xMenu Project 'Quit Gui' '' ''
- guiquit gui4cli.gc
-
- xMenu Project 'Quit Gui4Cli' '' ''
- quit
-
- ; --------------- guis menu
-
-
- xMenu Guis "File Manager" '' ''
- guiload guis:dir/dir.gc
- guiopen dir.gc
- guiclose gui4cli.gc
-
- xMenu Guis FSearch.gc '' ''
- guiload guis:g4c/fsearch/fsearch.gc Sys:
- guiclose gui4cli.gc
-
- xMenu Guis Rep.gc '' ''
- guiload guis:g4c/rep.gc
- guiclose gui4cli.gc
-
- xMenu Guis CedBar.gc '' ''
- guiload guis:g4c/ced/cedbar.gc
- guiclose gui4cli.gc
-
- xMenu Guis "BARLABEL" '' ''
-
- xMenu Guis Demo '' ''
- guiload guis:demo.gc
- guiopen demo.gc
- guiclose gui4cli.gc
-
- xMenu Guis Tutorials '' ''
- guiload guis:docs/tutorials.gc
- guiopen tutorials.gc
- guiclose gui4cli.gc
-
-
- ; --------------- Help menu
-
- xMenu Help "Gui4Cli Guide" '' ''
- run 'multiview guis:docs/gui4cli.guide'
-
- xMenu Help "Command List" '' ''
- guiload guis:tools/read.gc guis:docs/PrintMe
-
- xMenu Help "Gui4Cli ReadMe" '' ''
- guiload guis:tools/read.gc guis:readme.now
-
- xMenu Help "Version Changes" '' ''
- guiload guis:tools/read.gc guis:docs/Changes
-
- xMenu Help "BARLABEL" '' ''
-
- xMenu Help "CLI Commands Guide" '' ''
- run 'multiview guis:docs/CLICommands.guide'
-
- xMenu Help "Routines Guide" '' ''
- run 'multiview guis:docs/Routines.guide'
-
- xMenu Help Tutorials.. '' ''
- guiload guis:docs/tutorials.gc
- guiopen tutorials.gc
-
-